from selenium import webdriver
from selenium.webdriver.support import expected_conditions as EC
import time
browser = webdriver.Firefox()
browser.get("http://bdfzsjsxx.lezhiyun.com/")
browser.find_element_by_id("iptUser").send_keys("0117611")
browser.find_element_by_id("iptPwd").send_keys("zzj123")
browser.find_element_by_id("loginBtn").click()
time.sleep(2)
browser.find_element_by_id("lzxNavBarAppsIcon").click()
time.sleep(1) 
browser.find_element_by_link_text("希悦校园").click()
time.sleep(3)

handles = browser.window_handles
for handle in handles:
    if handle != browser.current_window_handle:
        browser.close() 
        browser.switch_to.window(handle) 
time.sleep(2)
browser.find_element_by_xpath("//li[contains(text(),'云课堂')]").click()
time.sleep(2)
browser.find_element_by_link_text("打开云课堂（Classin）").click()
time.sleep(2)
browser.close()


time.sleep(3)

